﻿namespace Wedn.Model.Data
{
    /// <summary>
    /// 评论表实体模型类(初步审核通过)
    /// </summary>
    public class Comment
    {
        #region 所有字段
        private int id;
        private int postId;
        private string auther;
        private string autherEmail;
        private string autherUrl;
        private string autherIp;
        private string pubDate;
        private string content;
        private int status;
        private int parentId;
        #endregion

        #region 对外属性
        /// <summary>
        /// 主键(自增长)字段
        /// </summary>
        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        /// <summary>
        /// 评论对应对象文章的ID字段
        /// </summary>
        public int PostId
        {
            get { return postId; }
            set { postId = value; }
        }
        /// <summary>
        /// 评论作者字段
        /// </summary>
        public string Auther
        {
            get { return auther; }
            set { auther = value; }
        }
        /// <summary>
        /// 评论人电子邮件地址字段
        /// </summary>
        public string AutherEmail
        {
            get { return autherEmail; }
            set { autherEmail = value; }
        }
        /// <summary>
        /// 评论人个人主页字段
        /// </summary>
        public string AutherUrl
        {
            get { return autherUrl; }
            set { autherUrl = value; }
        }
        /// <summary>
        /// 评论作者IP字段
        /// </summary>
        public string AutherIp
        {
            get { return autherIp; }
            set { autherIp = value; }
        }
        /// <summary>
        /// 评论发布日期字段
        /// </summary>
        public string PubDate
        {
            get { return pubDate; }
            set { pubDate = value; }
        }
        /// <summary>
        /// 评论内容字段
        /// </summary>
        public string Content
        {
            get { return content; }
            set { content = value; }
        }
        /// <summary>
        /// 评论当前审核状态(0:待审核,1:垃圾评论,2:审核通过)字段
        /// </summary>
        public int Status
        {
            get { return status; }
            set { status = value; }
        }
        /// <summary>
        /// 管理员对该评论回复字段
        /// </summary>
        public int ParentId
        {
            get { return parentId; }
            set { parentId = value; }
        }
        #endregion

        #region 构造函数
        public Comment() { }
        /// <summary>
        /// 评论表实体模型类
        /// </summary>
        /// <param name="id">评论表ID</param>
        /// <param name="postId">对应文章ID</param>
        /// <param name="auther">评论作者</param>
        /// <param name="autherEmail">评论人电子邮箱</param>
        /// <param name="autherUrl">评论人个人主页</param>
        /// <param name="autherIp">评论人IP</param>
        /// <param name="pubDate">评论时间</param>
        /// <param name="content">评论内容</param>
        /// <param name="status">评论当前审核状态</param>
        /// <param name="parentId">父评论ID</param>
        public Comment(int id, int postId, string auther, string autherEmail, string autherUrl, string autherIp, string pubDate, string content, int status, int parentId)
        {
            this.id = id;
            this.postId = postId;
            this.auther = auther;
            this.autherIp = autherIp;
            this.autherEmail = autherEmail;
            this.autherUrl = autherUrl;
            this.pubDate = pubDate;
            this.content = content;
            this.status = status;
            this.parentId = parentId;
        } 
        #endregion
    }
}
